package com.oreilly.justspring.core.ch3;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TradeServiceClient {
	private ApplicationContext ctx = null;

	  public TradeServiceClient() {
	    ctx = new ClassPathXmlApplicationContext("ch3-beans.xml");
	  }
	  public TradeService getTradeService(){
		  TradeService s = (TradeService) ctx.getBean("tradeService");
		  return s.getTradeService();
	  }
	  
	public static void main(String[] args) {
		TradeServiceClient client = new TradeServiceClient();
		System.out.println("TradeService: "+client.getTradeService());
	}
}
